home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / impr_base.idb / usr / lib / print / data / text2psProlog.z / text2psProlog
Encoding:
Text File  |  1997-07-30  |  3.3 KB  |  170 lines

  1. %!PS-Adobe-3.0 Resource-ProcSet
  2. %%Title: text2psProlog
  3. %%Copyright: 1994 Silicon Graphics, Inc. All rights reserved.
  4. %%BeginResource: procset text2psProcs 1.0 0
  5. %
  6. % This prolog contains the procedure and variable definitions for
  7. % the text2ps filter program.
  8. %
  9. /text2psDict 200 dict def
  10. text2psDict begin
  11.  
  12. % proc BD
  13. /BD { bind def } bind def
  14.  
  15. % x y M
  16. /M /moveto load def
  17.  
  18. % string show
  19. /S /show load def
  20.  
  21. % font SF
  22. /SF /setfont load def
  23.  
  24. % str x y MS
  25. /MS { M S } BD
  26.  
  27. % len x y pos thk UL
  28. /UL {
  29.     gsave
  30.     0.0 setgray setlinewidth
  31.     newpath
  32.     add M 0 rlineto
  33.     stroke
  34.     grestore
  35. } BD
  36.  
  37. % pageWidth RotatePage
  38. /RotatePage { 90.0 rotate 0.0 exch translate } BD
  39.  
  40. % xi yi sf xf yf FitPage
  41. /FitPage { translate dup scale translate } BD
  42.  
  43. % size fontname F
  44. /F { findfont exch scalefont } BD
  45.  
  46. % Reencode the specified font
  47. % newFontname newEncodingArray existingFontname RE
  48. /RE {
  49.     findfont dup length dict begin
  50.     {
  51.         1 index /FID ne
  52.         { def } { pop pop } ifelse
  53.     } forall
  54.     /Encoding exch def
  55.     /FontName 1 index def
  56.     currentdict definefont pop
  57.     end
  58. } BD
  59.  
  60. % true if ISOLatin1Encoding vector is defined, false if not
  61. /HaveISO /ISOLatin1Encoding where { pop true } { false } ifelse def
  62.  
  63. % width height llx lly Box
  64. /Box {
  65.     newpath
  66.     M 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  67.     closepath
  68. } BD
  69.  
  70. % width height llx lly BeginCol
  71. /BeginCol { gsave Box clip } BD
  72.  
  73. % EndCol
  74. /EndCol { grestore } BD
  75.  
  76. % gray width height llx lly BF
  77. /BF { gsave setgray Box fill grestore } BD
  78.  
  79. % pageNum x y font PageNumHeader
  80. /PageNumHeader { gsave SF MS grestore } BD
  81.  
  82. % pageNum pageNumWidth urx centerStr hspace leftStr llx lly font SimpleHeader
  83. /SimpleHeader {
  84.     gsave
  85.     newpath
  86.     SF MS 0 rmoveto S currentpoint exch pop M neg 0 rmoveto S
  87.     grestore
  88. } BD
  89.  
  90. % topStr topX topY bottomStr bottomX bottomY width height llx lly
  91. % font GaudyLHeader
  92. /GaudyLHeader {
  93.     gsave
  94.     SF 0.8 BF MS MS
  95.     grestore
  96. } BD
  97.  
  98. % topStr topX topY bottomStr bottomX bottomY width height llx lly
  99. % font GaudyCHeader
  100. /GaudyCHeader {
  101.     gsave
  102.     SF 3 -1 roll 2 div 3 1 roll 0.95 BF MS MS
  103.     grestore
  104. } BD
  105.  
  106. % pageNum pageNumX pageNumY width height llx lly font GaudyRHeader
  107. /GaudyRHeader {
  108.     gsave
  109.     SF 0.8 BF MS
  110.     grestore
  111. } BD
  112.  
  113. % height llx lly ColSep
  114. /ColSep {
  115.     gsave
  116.     newpath
  117.     0 setgray 0.125 setlinewidth
  118.     M 0 exch rlineto
  119.     stroke
  120.     grestore
  121. } BD
  122.  
  123. % xf yf sf xi yi FitLines
  124. /FitLines { translate dup scale translate } BD
  125.  
  126. % llxt llyt urxt uryt llxtFixed llytFixed urxtFixed urytFixed InitFitPage
  127. /InitFitPage {
  128.     /urytFixed exch def
  129.     /urxtFixed exch def
  130.     /llytFixed exch def
  131.     /llxtFixed exch def
  132.  
  133.     /uryt exch def
  134.     /urxt exch def
  135.     /llyt exch def
  136.     /llxt exch def
  137.  
  138.     /textXc urxt llxt add 2 div neg def
  139.     /textYc uryt llyt add 2 div neg def
  140.  
  141.     newpath clippath pathbbox
  142.  
  143.     urytFixed 1 eq { pop uryt } { uryt 2 copy ge {exch} if pop } ifelse
  144.     /ury exch def
  145.     urxtFixed 1 eq { pop urxt } { urxt 2 copy ge {exch} if pop } ifelse
  146.     /urx exch def
  147.     llytFixed 1 eq { pop llyt } { llyt 2 copy le {exch} if pop } ifelse
  148.     /lly exch def
  149.     llxtFixed 1 eq { pop llxt } { llxt 2 copy le {exch} if pop } ifelse
  150.     /llx exch def
  151.  
  152.     /pageXc urx llx add 2 div def
  153.     /pageYc ury lly add 2 div def
  154.  
  155.     urx llx sub urxt llxt sub div    % X scale factor
  156.     ury lly sub uryt llyt sub div    % Y scale factor
  157.     2 copy ge { exch } if pop    % Use min scale factor
  158.     /pageSF exch def
  159. } BD
  160.  
  161. % FitPage
  162. /FitPage {
  163.     pageXc pageYc translate
  164.     pageSF dup scale
  165.     textXc textYc translate
  166. } BD
  167.  
  168. end
  169. %%EndResource
  170.